﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace libStorage
{
    public interface IStorageProvider
    {
        /// <summary>
        /// init function called when the storage enginge has to initial itselfe
        /// </summary>
        /// <returns>success of the initialization</returns>
        bool init();
        /// <summary>
        /// Stores a list of ojects persistently
        /// </summary>
        /// <typeparam name="T">Type to be saved</typeparam>
        /// <param name="ToStore">Objects to save</param>
        void Store<T>(List<T> ToStore);
        /// <summary>
        /// Loads all Objects of the given Type from the storage
        /// </summary>
        /// <typeparam name="T">Type to be loaded</typeparam>
        /// <returns>loaded objects</returns>
        List<T>Load<T>();
        /// <summary>
        /// Load all ojects from the storage engine that match the plattern object
        /// </summary>
        /// <typeparam name="T">Type to be loaded</typeparam>
        /// <param name="Plattern">Plattern object all objects match this plattern are loaded</param>
        /// <returns>loaded objects</returns>
        List<T> Load<T>(T Plattern);
        /// <summary>
        /// Gets a userControl to configure the storage engine and save it's data all config 
        /// load / save logic has to be done by the userControl.
        /// </summary>
        /// <returns>UserControl for configuration</returns>
        UserControl getConfigControl();
        /// <summary>
        /// Gets the name of the Storageprovider
        /// </summary>
        /// <returns>Name of the Storageprovider</returns>
        string Name();
        /// <summary>
        /// Gets the disciption of the Storageprovider
        /// </summary>
        /// <returns>discription of the provider</returns>
        string Discription();

    }
}
